In starting and running processes of network equipment, control layer software may frequently interact with a chip. For example, in an initialization process of the chip, a great number of registers may be configured by the chip; and for another example, in a running process of the chip, a user may issue many kinds of configurations and operate a great number of table entries of the chip. For the chip, the main operation is to read and write an internal or external memory and internal register of the chip. At present, many table entries of the network equipment and the configurations of the register are implemented by message interaction between the chip and a Central Processing Unit (CPU).
At present, a Linux operating system is widely applied to a network equipment driver, wherein the Linux operating system comprises two levels, i.e. a user-state level and a kernel-state level, FIG. 1 is a diagram of levels of equipment driver software of the Linux operating system in a related art, and as shown in FIG. 1, the following description is given by taking the CPU and the network chip as an example. The CPU includes two levels: a user-state level and a kernel-state level, which correspond to a user-state memory and a kernel-state memory respectively, and the CPU is connected with the network chip through a bus. FIG. 2 is a diagram of levels of ordinary message sending driver software in the related art, and as shown in FIG. 2, a method for sending a message by a network equipment driver usually includes: applying for a user-state memory for each message, filling the message into the user-state memory, switching to a kernel state by calling a write system, copying a content of the message into a kernel-state buffer area from the user-state memory, and finally writing the message into the chip. FIG. 3 is a diagram of levels of ordinary message receiving driver software in the related art, and as shown in FIG. 3, the message receiving flow includes: introducing a hardware interrupt due to message reporting, reading a message into a kernel buffer area from a chip by virtue of a kernel driver, then switching to a user state by calling a read system, and reading the message into a user-state memory from the kernel buffer area. Every time when a message is sent and received, user-state memory application and releasing operation may be introduced, one user state and kernel state switching is further introduced, and user state and kernel state switching overhead of the Linux operating system is very high.
The conventional methods are only applied to the condition of low message sending and receiving efficiency. If the throughput of message interaction between the CPU and the chip is relatively higher, the system may continuously apply for and release the memory and continuously perform user space and kernel space switching (or called user state and kernel state switching), which may cause a great burden of the CPU of network equipment and also reduce message transmission efficiency.
Therefore, frequent switching between states may cause the problems of high resource overhead and low message transmission efficiency under the condition of large message interaction between the CPU and the chip in the related art.